package liuyuyang.controller;

import liuyuyang.domain.User;
import liuyuyang.pojo.Result;
import liuyuyang.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserService userService;

    @GetMapping
    public Result<List<User>> list(){
        return Result.success(userService.list());
    }
}
